package com.yc.forum.servlet;

import com.yc.forum.dao.CategoryDao;
import com.yc.forum.util.Utils;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * 查询用户的收藏记录
 */
@WebServlet(name="QueryPostServlet",value = "/getPost.s")
public class QueryPostByAccountServlet extends HttpServlet {
    private CategoryDao categoryDao=new CategoryDao();
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String account=req.getParameter("account");
        List<Map<String,Object>> collectionList= categoryDao.select_user_collection_post(account);
        Utils.toJson(collectionList,resp);
    }
}
